<?php
/**
 * 进程
 * @Author   Wcj
 * @DateTime 2019/3/15 16:30
 */

$process = new swoole_process(function(swoole_process $pro){
    // 类似 php redis.php
    $pro->exec('/usr/bin/php', ['/home/wwwroot/learn_swoole/http_server/http_server.php']);
}, true);

// 开启进程，返回pid
$pid = $process->start();
echo $pid . PHP_EOL;

// 回收结束运行的子进程, 默认为阻塞
swoole_process::wait();